package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.PlotsMapper;
import com.youlai.boot.system.model.QB.Plots;
import com.youlai.boot.system.service.PlotsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class PlotsServiceImpl extends ServiceImpl<PlotsMapper, Plots> implements PlotsService {
    @Autowired
    private PlotsMapper plotsMapper;
    @Override
    public boolean savePlots(Plots basc) {
        basc.setAddtime(LocalDateTime.now());
        return save(basc);
    }

    @Override
    public List<Plots> getAllPlots() {
        return plotsMapper.selectList(null);
    }

    @Override
    public boolean deletePlotsById(Integer id) {
        return baseMapper.deleteById(id) > 0;
    }
}
